function  [texture_mat,location_mat, color_mat,geometry_mat,shape_mat] = normalize_data_reg(org_text_mat,org_loc_mat,org_color_mat,org_geom_mat,org_shape_mat)

% This function normalize data that comes from regions' features.
 
% Function Inputs:
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% org_text_mat - texture fetures matrix
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% org_loc_mat - location fetures matrix
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% org_color_mat - color fetures matrix
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% org_geom_mat - geometry fetures matrix
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% org_shape_mat - shape fetures matrix
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

% Function Outputs:
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% texture_mat - texture fetures matrix after normalization
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% location_mat - location fetures matrix after normalization
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% color_mat - color fetures matrix after normalization
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% geometry_mat - geometry fetures matrix after normalization
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% shape_mat - shape fetures matrix after normalization
%-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

texture_mat = org_text_mat;
location_mat = org_loc_mat;
color_mat = org_color_mat;
geometry_mat = org_geom_mat;
shape_mat = org_shape_mat;
filters_num=24;       

% texture_mat
text_min = min(org_text_mat,[],2);
text_max = max(org_text_mat,[],2); 
for i=1:filters_num+1
    texture_mat(i,:) = (org_text_mat(i,:) - text_min(i))/(text_max(i) - text_min(i));
end 
texture_mat(filters_num+2,:) = (org_text_mat(filters_num+2,:) - 1)/(filters_num-1);
texture_mat(filters_num+3,:) = (org_text_mat(filters_num+3,:) - text_min(filters_num+3))/(text_max(filters_num+3) - text_min(filters_num+3));
% location_mat
location_mat = org_loc_mat;
% color_mat
for i=1:3
    color_mat(i,:) = org_color_mat(i,:) /255;
end
% geometry_mat
geom_min = min(org_geom_mat(1,:));
geom_max = max(org_geom_mat(1,:)); 
geometry_mat(1,:) = (org_geom_mat(1,:) - geom_min)/(geom_max - geom_min); 
% shape_mat
shape_min = min(org_shape_mat,[],2);
shape_max = max(org_shape_mat,[],2); 
for i=1:2
    shape_mat(i,:) = (org_shape_mat(i,:) - shape_min(i))/(shape_max(i) - shape_min(i));
end 